/**
 * @file rank/elementary/luogu1320/main.cpp
 * @brief
 * @see
 * @author Ruiming Guo (guoruiming@stu.scu.edu.cn)
 * @copyright 2022
 * @date 2022/7/7 14:45:10
 **/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int n;
const int N = 210;
string s;
int main() {
  // High rating and good luck!
  cin >> s;
  n = s.size();
  for (int i = 1; i < n; ++i) {
    string buf;
    cin >> buf;
    s += buf;
  }
  char state = '0';  // 注意初始状态
  int i = 0;
  int cnt = 0;
  cout << n << ' ';
  while (i < n * n) {
    if (s[i] == state) {
      cnt++;
      i++;
    } else {
      cout << cnt << ' ';
      state = s[i];
      cnt = 0;
    }
  }
  if (cnt) cout << cnt << ' ';
  cout << endl;
  return 0;
}
